<div id="clientsPage">
<div class="post">
    <h2 class="title">Clients</h2>
    <div class="entry">
        <script>
            $(function() {
                $( "#client_datepicker" ).datepicker({ dateFormat: 'yy-mm-dd' });
            });
        </script>
         <script>
            $(function() {
                $( "#client_datepicker2" ).datepicker({ dateFormat: 'yy-mm-dd' });
            });
        </script>

        <input type="button" value="Add new" onclick="show('#new_client')"/>
      <input type="button" value="Search" onclick="show('#searchClients')"/>

            <script type="text/javascript">
                function searchClients(){
                    field=document.getElementById("searchClientsForm").field.value;
                    search=document.getElementById("searchClientsForm").search.value;
                    $("#clientsPage").load("<?= base_url(); ?>index.php?/admin_mis/clients/"+field+"/"+search);
                }
            </script>
        <div id="client_result" class="info">
            <?= $message; ?>
        </div>
        <!--a href="" id="hide3" >Hide</a> <a href="" id="show3" >Show</a-->
        <div id="new_client" style="display: none;margin-bottom: 10px;">
            <?php $data['id'] = "client_form" ?>
            <?= form_open_multipart('mis/saveClient', $data); ?>
            <table>
                 <tr  class="darker"><td>Client Name</td><td><input type="text"  class="wide" name="client_name" value="<?php echo set_value('client_name'); ?>" /></td> </tr>
                <tr class="lighter"><td class="half">Client From</td><td><input type="text" class="wide" name="client_from" value="<?php echo set_value('client_from'); ?>" id="client_datepicker" s /></td> </tr>
                <tr class="darker"><td>Client To</td><td><input type="text" class="wide"  name="client_to" value="<?php echo set_value('client_to'); ?>" id="client_datepicker2" /></td> </tr>
                <tr  class="lighter"><td>Purpose </td><td><input type="text"  class="wide" name="purpose" value="<?php echo set_value('purpose'); ?>" /></td> </tr>
                 <tr  class="darker"><td>Remarks(More details)</td><td><input type="text"  class="wide" name="remarks" value="<?php echo set_value('remarks'); ?>" /></td> </tr>
                
                <tr><td colspan="2" style="text-align: right">
                        <input type="submit" value="Submit" />
                        <input type="button" value="Cancel" onclick="hide('#new_client')"/>
                    </td></tr>
            </table>
            </form>
        </div>



            <div id="searchClients" style="display: none;margin-bottom: 10px;">
                <form id="searchClientsForm">
                    <table>
                        <tr class="darker"><td class="half">Select search criteria</td>
                            <td><select name="field">
                                    <option selected="selected" value='added_by'> Added by</option>
                                    <option value='sent_to' >Sent to</option>
                                </select></td>
                            <td><input type="text" name="search" class="wide"  value="<?php echo set_value('added_by'); ?>" /></td>
                        </tr>

                        <tr><td colspan="3" style="text-align: right">
                                <input type="button" value="Submit" onclick="searchClients()" />
                                <input type="button" value="Cancel" onclick="hide('#searchClients')"/>
                            </td></tr>

                    </table>
                </form>
            </div>




        <div id="all_client">
            <?= $tablet ?>
            <?= $pagina ?>
        </div>

    </div>
</div>
</div>